package com.kly.util;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.fqgj.exception.common.ApplicationException;
import org.springframework.util.StringUtils;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 参数检验类
 * @author linqu
 */
public class ValidateParams {

    public static void notEmpty(String str, String errorMsg) throws ApplicationException {
        if (str == null || StringUtils.isEmpty(str.trim())) {
            throw new ApplicationException(errorMsg);
        }
    }

    public static void assertTrue(boolean flag, String errorMsg) throws ApplicationException {
        if (flag) {
            throw new ApplicationException(errorMsg);
        }
    }
}
